package com.niit.session18;

import java.util.Map;
import java.util.TreeMap;

public class TreeMapDemo {
	public static void main(String[] args) {
//		TreeMap可以让存进来的值按照键进行排序
		Map<Integer, Student> map = new TreeMap<Integer, Student>();
		Student student1 = new Student("张三",19);
		Student student2 = new Student("李四",20);
		Student student3 = new Student("王五",21);
		map.put(1, student1);
		map.put(13, student2);
		map.put(10, student3);
		map.put(11, student3);
		map.put(100, student3);
		System.out.println(map);
		
	}

}
